{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function(){
});
function setRateAll(allRate)
{
	$('.rate').val($(allRate).val());
}
</script>
{/block}
{block name=body}
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="50%">
<tr>
	<td class="table1" align="center">
		Party : 
	  <select name="partyId" id="partyId" required="required" AUTOFOCUS>
	  <option value="0">All</option>
	  {html_options values=$catTitleArray.partyId output=$catTitleArray.partyName}
	  </select>
	</td>
	<td class="table1" align="center">Final Process : 
		<select name="finalProcessId" AUTOFOCUS>
			<option value="0">All</option>
			{html_options values=$materialArray.finalProcessId output=$materialArray.finalProcessName selected=$selfinalProcessId}
	  </select>
	</td>
	<td class="table1" align="center"><input type="submit" name="showData" value=" Show " /></td>
</tr>
</table>
</form>
<br />
{if $partyArray != 0}
<form name="form2" id="form2" action="{$smarty.server.PHP_SELF}" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="auto">
<tr><td class="table1" align="center" colspan="2">Party : {$partyArray.partyName}<input type="hidden" name="insPartyId" value="{$partyArray.partyId}" /></tr>
<tr>
	<td class="table1" align="center">Final Process</td>
	<td class="table1" align="center">Rate</td>
</tr>
{section name=mSec loop=$matArray}
<tr>
	<td class="table1" align="left">{$matArray[mSec].finalProcessName}</td>
	{if $matArray[mSec].finalProcessId == 0}
	  <td class="table1" align="center"><input type="text" name="rate[{$matArray[mSec].finalProcessId}]" onblur="setRateAll(this);" value="0" size="2" style="text-align:right;" /></td>
	{else}
	  <td class="table2" align="center"><input type="text" name="rate[{$matArray[mSec].finalProcessId}]" class="rate" value="0" size="5" style="text-align:right;" /></td>
	{/if}
</tr>
{/section}
<tr><td class="table1" align="center" colspan="2"><input type="submit" name="storeRateBtn" value=" Store " /></td></tr>
</table>
</form>
{/if}
{/block}